home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / SASETUP.MSI / F77532_helptoc.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  4.4 KB  |  166 lines

  1. <%@ Language=VBScript   %>
  2. <%    Option Explicit     %>
  3. <%
  4.     '-------------------------------------------------------------------------
  5.     ' Server Appliance Help Table of contents
  6.     ' Copyright (c) Microsoft Corporation.  All rights reserved.
  7.     '-------------------------------------------------------------------------
  8.     Call SAI_EnablePageCaching(TRUE)
  9. %>
  10.     <!-- #include file="inc_framework.asp" -->
  11. <%
  12.     '-------------------------------------------------------------------------
  13.     ' Global Variables
  14.     '-------------------------------------------------------------------------
  15.     Dim rc
  16.     Dim page
  17.     
  18.     '-------------------------------------------------------------------------
  19.     ' Global Form Variables
  20.     '-------------------------------------------------------------------------
  21.     
  22.     '======================================================
  23.     ' Entry point
  24.     '======================================================
  25.     Dim L_PAGETITLE
  26.  
  27.     L_PAGETITLE = SA_GetLocString("sacoremsg.dll", "40200FA0", "")
  28.     
  29.     '
  30.     ' Create Page
  31.     rc = SA_CreatePage( L_PAGETITLE, "", PT_AREA, page )
  32.  
  33.     '
  34.     ' Show page
  35.     rc = SA_ShowPage( page )
  36.  
  37.     
  38.     '======================================================
  39.     ' Web Framework Event Handlers
  40.     '======================================================
  41.     
  42.     '---------------------------------------------------------------------
  43.     ' Function:    OnInitPage
  44.     '
  45.     ' Synopsis:    Called to signal first time processing for this page. Use this method
  46.     '            to do first time initialization tasks. 
  47.     '
  48.     ' Returns:    TRUE to indicate initialization was successful. FALSE to indicate
  49.     '            errors. Returning FALSE will cause the page to be abandoned.
  50.     '
  51.     '---------------------------------------------------------------------
  52.     Public Function OnInitPage(ByRef PageIn, ByRef EventArg)
  53.             OnInitPage = TRUE
  54.     End Function
  55.  
  56.     
  57.     '---------------------------------------------------------------------
  58.     ' Function:    OnServeAreaPage
  59.     '
  60.     ' Synopsis:    Called when the page needs to be served. Use this method to
  61.     '            serve content.
  62.     '
  63.     ' Returns:    TRUE to indicate not problems occured. FALSE to indicate errors.
  64.     '            Returning FALSE will cause the page to be abandoned.
  65.     '
  66.     '---------------------------------------------------------------------
  67.     Public Function OnServeAreaPage(ByRef PageIn, ByRef EventArg)
  68.         Dim sURL
  69.         Dim sFirstHelpURL
  70.         Dim sTOCWidth
  71.         Dim sTOCHeight
  72.         Dim sContentWidth
  73.         Dim sContentHeight
  74.         
  75.         sURL = m_VirtualRoot + "sh_tree.asp"
  76.  
  77.         Call SA_MungeURL(sURL, "TreeContainer", "HelpTOC")
  78.         Call SA_MungeURL(sURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
  79.  
  80.         sFirstHelpURL = GetFirstHelpPage("HelpTOC")
  81.         
  82.         Call SA_MungeURL(sFirstHelpURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
  83.         
  84.         If ( SA_IsIE() ) Then
  85.         
  86.             sTOCWidth = "100%"
  87.             sTOCHeight = "500px"
  88.             sContentWidth = "100%"
  89.             sContentHeight = "500px"
  90.         
  91.         Else
  92.             sTOCWidth = "200px"
  93.             sTOCHeight = "500px"
  94.             sContentWidth = "600px"
  95.             sContentHeight = "500px"
  96.         End If
  97.         
  98.         %>
  99.         <script>
  100.         function Init()
  101.         {
  102.         }
  103.         </script>
  104.         <BODY>
  105.         <table width=97% border=0>
  106.         <tr>
  107.             <td xclass=HelpTOC width=25% nowrap valign=top align=left>
  108.             <IFRAME src='<%=sURL%>' border=0 frameborder=0 name=IFrameHelpMain width='<%=sTOCWidth%>' height='<%=sTOCHeight%>'>
  109.             </IFRAME>
  110.             </td>
  111.  
  112.             <td class=HelpTOC width=10px nowrap valign=top>
  113.              
  114.             </td>
  115.  
  116.             <td width=75% valign=top align=left>
  117.             <IFRAME border=0 frameborder=0 name=IFrameHelpContent src='<%=sFirstHelpURL%>' width='<%=sContentWidth%>' height='<%=sContentHeight%>'>")
  118.             </IFRAME>
  119.             </td>
  120.         </tr>
  121.         </table>
  122.         </BODY>
  123.         <%
  124.         OnServeAreaPage = TRUE
  125.     End Function
  126.  
  127.  
  128.     '======================================================
  129.     ' Private Functions
  130.     '======================================================
  131.     Private Function GetFirstHelpPage(ByVal sContainer)
  132.         on error resume next
  133.         Err.Clear
  134.         
  135.         Dim sURL
  136.         Dim sHelpLoc
  137.         Dim oContainer
  138.         Dim oElement
  139.         
  140.         GetFirstHelpPage = ""
  141.         
  142.         Set oContainer = GetElements(sContainer)
  143.         If ( Err.Number <> 0 ) Then
  144.             Call SA_TraceOut("HelpTOC", "GetFirstHelpPage : GetElements("+sContainer+") returned error: " + CStr(Hex(Err.Number)) )
  145.             Err.Clear
  146.             Exit Function
  147.         End If
  148.  
  149.  
  150.         Call SA_GetHelpRootDirectory(sHelpLoc)
  151.         
  152.         For each oElement in oContainer
  153.             Dim sHelpURL
  154.             sHelpURL = sHelpLoc+oElement.GetProperty("URL")
  155.             GetFirstHelpPage = sHelpURL
  156.             Set oContainer = Nothing
  157.             Exit Function
  158.         Next
  159.  
  160.         Set oContainer = Nothing
  161.         
  162.     End Function
  163.  
  164. %>
  165.  
  166.